<!-- Begin: Wrapper Header -->
<div class="header hidden">
    <? Shell::showWidgets('wrapper-header') ?>
</div> <!-- End -->

<!-- Begin: Sidebar Left -->
<div class="sidebar left">
    <? Shell::showWidgets('sidebar-left') ?>                
</div> <!-- End -->

<!-- Begin: Content Vehicle -->
<div class="content vehicle">
    <div class="header">
        <h1><?= Vehicle::$data->m_name . ' ' . Vehicle::$data->c_name. ' ' . Vehicle::$data->version . ' ' . Vehicle::$data->firstreg ?></h1>
        <h2><?= Vehicle::$data->t_name . ' > ' . Vehicle::$data->b_name ?></h2>
    </div>
    <div class="photos">
        <ul>
            <? foreach (Vehicle::$pictures as $picture): ?>
                <li><img src="<?= _VHC_IMG_ . 'view/' . $picture->filename ?>" class="mini"></li>
            <? endforeach ?>
        </ul>
    </div>
    <div class="details">
        <div class="value">R$ <?= Util::format_money(Vehicle::$data->price - Vehicle::$data->discount) ?></div>
        <div class="details-vehicle">
            <ul>
                <li><b>Marca:</b> <?= Vehicle::$data->b_name ?></li>
                <li><b>Modelo:</b> <?= Vehicle::$data->m_name ?></li>
            </ul>
            <ul>
                <li><b>Motor:</b> <?= Vehicle::$data->engine ?></li>
                <li><b>Cor:</b> <?= Vehicle::$data->c_name ?></li>
            </ul>
            <ul>
                <li><b>Combutível:</b> <?= Vehicle::$data->f_name ?></li>
                <li><b>Ano:</b> <?= Vehicle::$data->firstreg . '/' . Vehicle::$data->modelyear ?></li>
            </ul>
            <ul>
                <li><b>Carro Novo:</b> <?= (Vehicle::$data->new) ? 'Sim' : 'Não' ?></li>
                <li><b>Quilometragem:</b> <?= Vehicle::$data->km ?></li>
            </ul>
        </div>
        <div class="details-description">
            <h1>Detalhes do Veículo</h1>
            <div class="details-description-itens">
                <?
                if (Vehicle::$details != null):
                    foreach (Vehicle::$details as $detail):
                        ?>
                        <div class="item"><?= $detail->name ?></div>
                        <?
                    endforeach;
                endif;
                if (Vehicle::$differentials != null):
                    foreach (Vehicle::$differentials as $differential):
                        ?>
                        <div class="item"><?= $differential->name ?></div>
                        <?
                    endforeach;
                endif
                ?>
            </div>
        </div>
        <div class="details-observation">
            <h1>Observações</h1>
            <div class="details-observation-text">
                <?= Vehicle::$data->observations ?>
            </div>
        </div>
    </div>
    <form id="proposal">
        <div class="name">
            <label>Nome:</label>
            <input class="input required" type="text" name="name" title="Nome">
        </div>
        <div class="phone">
            <label>Telefone:</label>
            <input class="input required" type="text" name="phone" title="Telefone">
        </div>
        <div class="email">
            <label>E-mail:</label>
            <input class="input required" type="text" name="email" title="E-mail">
        </div>
        <div class="message">
            <label>Mensagem:</label>
            <textarea class="input required message" name="message" title="Mensagem"></textarea>
        </div>
        <input type="hidden" name="id" value="<?= Vehicle::$data->v_id ?>">
        <input class="submit" type="submit" value="Enviar Proposta">
    </form>
    <div class="advertiser">
        <a class="title" href=""><?= Vehicle::$advertiser->c_name . Vehicle::$advertiser->fancyname ?></a>
        <div class="logo">
            <? if (!isset(Vehicle::$advertiser->cnpj)): ?>
                <span class="private">Veículo Particular</span>
                <?
            else:
                if (!empty(Vehicle::$advertiser->filebrand)):
                    ?>
                    <img src="<?= _ETP_IMG_ . 'logo/' . Vehicle::$advertiser->filebrand ?>">
                <? else: ?>
                    <img src="<?= _ETP_IMG_ ?>logo/no-image.jpg" />
                <?
                endif;
                if (!empty(Vehicle::$advertiser->website)):
                    ?>
                    <a href="http://<?= Vehicle::$advertiser->website ?>" target="_blank">Visite nosso website</a>
                    <?
                endif;
            endif;
            ?>
        </div>
        <div class="description">
            <p class="address">
                <?= Vehicle::$advertiser->address . ', ' . Vehicle::$advertiser->number . ' - ' . Vehicle::$advertiser->complement ?><br/>
            <?= Vehicle::$advertiser->district . ' - ' . Vehicle::$advertiser->ct_name . ' - ' . Vehicle::$advertiser->st_symbol ?>
            </p>
            <? foreach (Vehicle::$phones as $phone): ?>
                <span class="phone"><?= Util::format_phone($phone->areacode . $phone->number) ?></span>
<? endforeach ?>
        </div>

    </div>
    <div class="price-analysis">
        <h3>Média de Valores</h3>
        <ul>
            <li class="current">
                <p>Valor desse veículo</p>
                <span>R$ <?= Util::format_money(Vehicle::$data->price - Vehicle::$data->discount) ?></span>
            </li>
            <li>
                <p>Valor médio Goiautos:</p>
                <span>R$ <?= Util::format_money(Vehicle::$prices_average->average) ?></span>
            </li>
            <li>
                <p>Maior preço anunciado:</p>
                <span>R$ <?= Util::format_money(Vehicle::$prices_average->more) ?></span>
            </li>
            <li>
                <p>Menor preço anunciado:</p>
                <span>R$ <?= Util::format_money(Vehicle::$prices_average->less) ?></span>
            </li>
        </ul>
    </div>
</div>

<!-- End -->
